27 #define _CRTDBG_MAP_ALLOC
164 #ifdef __RECORDFARMEVENTS
165 ofstream *m_farmeventfile;
184 #ifdef __RECORDFARMEVENTS
185 void RecordEvent(
int a_event,
int a_day,
int a_year) {
186 (*m_farmeventfile) << a_event <<
'\t' << a_day <<
'\t' << a_year << endl;
208 void PolysDump(
const char *a_filename );
209 void DumpMap(
const char *a_filename );
215 unsigned int sz = (int)
m_elems.size();
216 for (
unsigned int i = 0; i < sz; i++)
228 void EventDump(
int x,
int y,
int x2,
int y2);
243 bool BorderTest(
int a_fieldpoly,
int a_borderpoly,
int a_x,
int a_y );
244 bool StepOneValid(
int a_polyindex,
int a_x,
int a_y,
int step );
245 bool UMarginTest(
int a_fieldpoly,
int a_borderpoly,
int a_x,
int a_y,
int a_width );
247 bool BorderStep(
int a_fieldpoly,
int a_borderpoly,
int* a_x,
int* a_y);
256 void AxisLoop(
int a_poly,
int* a_x,
int* a_y,
int a_axis);
294 int a_neighbour_color );
308 void hb_dump_map(
int a_beginx,
int a_width,
309 int a_beginy,
int a_height,
311 bool a_high_numbers );
312 int hb_dump_color(
int a_x,
int a_y,
313 bool a_high_numbers );
449 int LineHighTest(
int a_cx,
int a_cy,
double a_offsetx,
double a_offsety);
548 if (a_goose == gs_Pinkfoot)
552 if (a_goose == gs_Barnacle)
554 if (a_height == 0.0)
return 0.0;
557 if (a_goose == gs_Greylag)
561 Warn(
"Landscape::SupplyGooseGrazingForage",
"Unknown Goose Type");
574 if (a_goose == gs_Pinkfoot)
578 if (a_goose == gs_Barnacle)
582 if (a_goose == gs_Greylag)
586 Warn(
"Landscape::SupplyGooseGrazingForage",
"Unknown Goose Type");
793 bool a_dump_zero_areas,
794 bool a_write_veg_names
797 void Warn( std::string a_msg1, std::string a_msg2 );
916 return m_elems[ a_index ]->GetDigestability();
933 return m_elems[ a_index ]->GetVegHeight();
950 return m_elems[ a_index ]->GetVegBiomass();
1055 return m_elems[ a_index ]->GetVegCover();
1065 return m_elems[a_index]->GetLastSownVeg();
1106 return m_elems[ a_index ]->GetElementType();
1195 return opf-> Get_farmType();
1202 return m_elems[ a_polyref ]->GetArea();
1222 return m_elems[ a_index ]->GetVegType();
1234 return m_elems[ a_index ]->GetCattleGrazing();
1260 return m_elems[ a_index ]->IsRecentlyMown();
1272 return m_elems[ a_index ]->IsRecentlySprayed();
1453 return m_elems[ a_index ]->GetPoly();
1463 return (
unsigned int)
m_elems.size();
1518 return m_elems[ a_magic ]->GetPoly();
1562 if (a_pt.
m_x < 0) a_pt.
m_x = 0;
1563 if (a_pt.
m_y < 0) a_pt.
m_y = 0;
class Calendar * g_date
Definition: calendar.cpp:38
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:53
int m_y
Definition: ALMaSS_Setup.h:56
int m_x
Definition: ALMaSS_Setup.h:55
int GetHour(void)
Definition: calendar.h:71
int GetMonth(void)
Definition: calendar.h:69
long Date(void)
Definition: calendar.h:57
double GetDaylightProportion(void)
Definition: calendar.h:73
int DayLength(void)
Definition: calendar.h:63
int GetYear(void)
Definition: calendar.h:67
int GetDayInMonth(void)
Definition: calendar.h:72
int GetYearNumber(void)
Definition: calendar.h:68
int GetMinute(void)
Definition: calendar.h:70
int DayInYear(void)
Definition: calendar.h:58
void DumpAllSymbolsAndExit(const char *a_dumpfile)
Definition: configurator.cpp:601
bool ReadSymbols(const char *a_cfgfile)
Definition: configurator.cpp:201
void DumpPublicSymbols(const char *a_dumpfile, CfgSecureLevel a_level)
Definition: configurator.cpp:590
virtual double GetY(double a_X)
Definition: CurveClasses.cpp:73
The base class for all farm types.
Definition: farm.h:768
The Farm Manager class.
Definition: farm.h:1707
int GetNoFarms()
Definition: farm.h:1900
Farm * GetFarmPtr(int a_owner)
Returns the pointer to a farm with a specific number.
Definition: farm.h:1766
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
Definition: elements.cpp:3610
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Definition: elements.cpp:2995
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: elements.cpp:3345
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: elements.cpp:3088
Definition: elements.h:81
The landscape class containing all environmental and topographical data.
Definition: landscape.h:113
void CorrectCoordsPointNoWrap(APoint &a_pt)
Function to prevent wrap around errors with co-ordinates using a APoint.
Definition: landscape.h:1555
bool m_NeedOpennessCalculation
a flag to ensure openness calculation on object construction
Definition: landscape.h:148
int hb_core_pixels
Definition: landscape.h:275
int SupplyJustSprayedVector(unsigned int a_index)
Definition: landscape.h:1270
TTypesOfVegetation SupplyLastSownVegVector(unsigned int a_index)
Definition: landscape.h:1063
int HowManyPonds()
Returns the number of ponds in the landscape.
Definition: landscape.h:336
void GrazeVegetationTotal(int a_poly, double a_forage)
Removes grazing forage from a poly and divides this out per m2.
Definition: landscape.h:676
int m_height10
Definition: landscape.h:141
PollenNectarQuality SupplyPollen(int a_polyref)
Definition: landscape.h:377
int SupplyYearNumber(void)
Definition: landscape.h:1616
void ChangeMapMapping(void)
Definition: Landscape.cpp:2130
bool IsFieldType(TTypesOfLandscapeElement a_tole)
Definition: landscape.h:727
void VegDump(int x, int y)
Definition: Landscape.cpp:1644
int m_LargestPolyNumUsed
Definition: landscape.h:194
long SupplyGlobalDate(void)
Definition: landscape.h:1621
int m_width
Definition: landscape.h:138
void TestCropManagement(void)
void SkylarkEvaluation(SkTerritories *a_skt)
Definition: Landscape.cpp:3025
bool m_DoMissingPolygonsManipulations
Definition: landscape.h:150
double SupplyDayDegrees(int a_polyref)
Definition: landscape.h:1326
int m_height
Definition: landscape.h:139
double SupplyHumidity(void)
Definition: landscape.h:1393
bool hb_MapBorder(int a_x, int a_y)
Definition: hedgebanks.cpp:325
APoint SupplyCentroid(int a_polyref)
Definition: Landscape.cpp:766
int hb_min_y
Definition: landscape.h:273
int SupplySimAreaMaxExtent(void)
Definition: landscape.h:1642
int SupplyPolyRefCC(int a_x, int a_y)
Definition: landscape.h:1500
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: landscape.h:1669
void hb_GenerateHBPolys(void)
Definition: hedgebanks.cpp:180
TTypesOfLandscapeElement SupplyElementTypeCC(int a_x, int a_y)
Definition: landscape.h:1139
int SupplySimAreaHeight(void)
Definition: landscape.h:1637
double SupplyDeadBiomass(int a_polyref)
Definition: landscape.h:1029
bool SupplyIsMatureCereal(int a_polyref)
Definition: landscape.h:1305
vector< int > m_PondRefsList
List of pond polyrefs.
Definition: landscape.h:199
double SupplyVegHeightVector(unsigned int a_index)
Definition: landscape.h:931
int RemoveSmallPolygons(void)
Removes small polygons from the map.
Definition: Landscape.cpp:2184
double SupplyTemp(void)
Definition: landscape.h:1386
int SupplyDaylength(void)
Definition: landscape.h:1530
void RecordGooseNumbers(int a_poly, int a_number)
This records the number of geese on the polygon the day before. To prevent lots of unnecessary cleari...
Definition: Landscape.cpp:3328
void UnsprayedMarginScan(LE *a_field, int a_width)
Definition: Landscape.cpp:2638
void RecordGooseSpNumbersTimed(int a_poly, int a_number, GooseSpecies a_goose)
This records the number of geese of each species on the polygon the day before at a predefined time....
Definition: Landscape.cpp:3363
void BorderScan(LE *a_field, int a_width)
Definition: Landscape.cpp:2365
void BuildingDesignationCalc()
used to calculate whether a building is rural or town - for rodenticide use
Definition: Landscape.cpp:3287
double SupplyTotalNectar(int a_polyref)
Definition: landscape.h:383
vector< LE * > hb_new_hbs
Definition: landscape.h:264
double SupplyWindPeriod(long a_date, int a_period)
Definition: landscape.h:1405
void hb_RestoreHedgeCore(int a_orig_poly_number)
Definition: hedgebanks.cpp:311
int SupplyVegDensity(int a_polyref)
Definition: landscape.h:975
double SupplyVegDigestabilityVector(unsigned int a_index)
Definition: landscape.h:914
int SupplyCountryDesig(int a_x, int a_y)
Definition: landscape.h:1132
void EventDump(int x, int y, int x2, int y2)
Definition: Landscape.cpp:1697
FarmManager * m_FarmManager
List of all the farms.
Definition: landscape.h:119
polylist * SupplyLargeOpenFieldsNearXY(int x, int y, int range, int a_openness)
Returns a pointer to a list of polygonrefs to large open fields within a range of location x,...
Definition: Landscape.cpp:782
double SupplyVegCover(int a_polyref)
Definition: landscape.h:1048
bool SupplyInStubble(int a_polyref)
Returns whether its cereal.
Definition: landscape.h:634
bool FindFieldCenter(LE *a_field, int *x, int *y)
Definition: Landscape.cpp:2799
bool SupplyJustMown(int a_polyref)
Definition: landscape.h:1263
void IncTreatCounter(int a_treat)
Definition: Landscape.cpp:3575
double SupplyWind(void)
Definition: landscape.h:1417
void IncOsmiaNest(int a_x, int a_y)
Reopen the osmia nest here
Definition: landscape.h:866
int CalulateFieldOpennessAllCells(int a_pref)
Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles...
Definition: Landscape.cpp:401
void hb_PaintBorder(int a_color)
Definition: hedgebanks.cpp:429
void GrazeVegetation(int a_poly, double a_forage)
Removes grazing forage from a poly per m2.
Definition: landscape.h:670
bool SupplyOsmiaNest(int a_x, int a_y)
Find out whether an osmia nest can be made here.
Definition: landscape.h:861
void SetThePopManager(Population_Manager *a_ptr)
Set the pointer to the current main population manager.
Definition: landscape.h:177
PesticideMap * m_PesticideMap
For specialised pesticide recording.
Definition: landscape.h:133
bool CIPELandscapeMaker()
double GetHareFoodQuality(int a_polygon)
Definition: Landscape.cpp:3403
int SupplyCentroidY(int a_polyref)
Definition: landscape.h:473
int SupplyFarmIntensityI(int a_polyindex)
Definition: Landscape.cpp:751
bool BorderStep(int a_fieldpoly, int a_borderpoly, int *a_x, int *a_y)
Definition: Landscape.cpp:2479
int SupplyGrazingPressureVector(unsigned int a_index)
Definition: landscape.h:1232
int hb_MaxUnpaintedNegNeighbour(int a_x, int a_y)
Definition: hedgebanks.cpp:548
double SupplyGooseGrazingForageH(int a_polygon, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by number ba...
Definition: landscape.h:567
TTypesOfOptFarms SupplyOptFarmType(int a_x, int a_y)
Definition: landscape.h:1191
double GetVegArea(int v)
Definition: landscape.h:170
int SupplyPondIndex(int a_pondref)
Returns the index of a pond based on pondref or -1 if not found.
Definition: landscape.h:342
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_BG
Definition: landscape.h:161
void CalculateOpenness(bool a_realcalc)
Causes openness to be calulated and stored for all polygons.
Definition: Landscape.cpp:322
TTypesOfFarm SupplyFarmType(int a_polyref)
Definition: landscape.h:1179
int SupplyUnderGrowthWidth(int, int)
Definition: landscape.h:815
double SupplyPesticide(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets total pesticide for a location.
Definition: Landscape.cpp:586
vector< int > m_polymapping
Definition: landscape.h:130
void CountMapSquares(void)
Definition: Landscape.cpp:2040
int SupplyFarmIntensity(int a_x, int a_y)
Definition: Landscape.cpp:756
void AxisLoop(int a_poly, int *a_x, int *a_y, int a_axis)
Definition: Landscape.cpp:2938
void FillVegAreaData()
Definition: Landscape.cpp:3641
int GetGooseNumbers(int a_poly)
This returns the number of geese on the polygon the day before.
Definition: Landscape.cpp:3383
int SupplyTreeHeight(int, int)
Definition: landscape.h:814
void SupplyLEReset(void)
Definition: Landscape.cpp:3551
double SupplyGlobalRadiation()
Definition: landscape.h:1341
double SupplyInsects(int a_polyref)
Definition: landscape.h:1088
double SupplyWeedBiomass(int a_polyref)
Definition: landscape.h:964
double SupplyVegHeight(int a_polyref)
Definition: landscape.h:936
double GetActualGooseGrazingForage(int a_polygon, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by x,...
Definition: landscape.h:607
void DumpMapGraphics(const char *a_filename)
Definition: Landscape.cpp:3599
void TurnTheWorld(void)
Definition: landscape.h:905
int hb_min_x
Definition: landscape.h:272
void DegreesDump()
Prints the sum of day degrees. See FarmManager::daydegrees.
Definition: Landscape.cpp:1687
int m_minmaxextent
Definition: landscape.h:142
Population_Manager * m_ThePopManager
a pointer to the current main population manager
Definition: landscape.h:155
void CentroidSpiralOut(int a_polyref, int &a_x, int &a_y)
Definition: Landscape.cpp:3073
int hb_border_pixels
Definition: landscape.h:276
vector< int > m_PondIndexList
List of pond indexes.
Definition: landscape.h:197
int SupplyLENext(void)
Definition: Landscape.cpp:3555
bool SupplyOverspray(int a_x, int a_y)
Gets the overspray flag.
Definition: Landscape.cpp:599
void SetBirdSeedForage(int a_polyref, double a_fooddensity)
Sets the grain forage resource as seen from a goose standpoint at a polygon.
Definition: landscape.h:528
void SetBirdMaizeForage(int a_polyref, double a_fooddensity)
Sets the maize forage resource as seen from a goose standpoint at a polygon.
Definition: landscape.h:535
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
Definition: landscape.h:1662
double SupplyTotalNectar(int a_x, int a_y)
Definition: landscape.h:384
void CreatePondList()
Creates a list of pond polygon refs/indexes for easy look up.
Definition: Landscape.cpp:2594
std::string EventtypeToString(int a_event)
Definition: Landscape.cpp:3918
int SupplyVegPhase(int a_poly)
Definition: landscape.h:179
RodenticidePredators_Population_Manager * SupplyRodenticidePredatoryManager()
Definition: landscape.h:432
int hb_width
Definition: landscape.h:269
void ResetGrainAndMaize()
Resets all grain.
Definition: Landscape.cpp:730
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_GL
Definition: landscape.h:162
void DumpPublicSymbols(const char *a_dumpfile, CfgSecureLevel a_level)
Definition: landscape.h:781
int hb_size
Definition: landscape.h:271
double SupplyPolygonAreaVector(int a_polyref)
Returns the area of a polygon using the vector index as a reference.
Definition: landscape.h:1200
std::string VegtypeToString(TTypesOfVegetation a_veg)
Definition: Landscape.cpp:4235
void hb_AddNewHedgebanks(int a_orig_poly_num)
Definition: hedgebanks.cpp:198
int * hb_map
Definition: landscape.h:268
double SupplyLAGreen(int a_polyref)
Definition: landscape.h:1041
int SupplyGrazingPressure(int a_polyref)
Definition: landscape.h:1227
int SupplyDayInMonth(void)
Definition: landscape.h:1606
void SetLESignal(int a_polyref, LE_Signal a_signal)
Definition: Landscape.cpp:3570
TTypesOfLandscapeElement SupplyElementTypeFromVector(unsigned int a_index)
Definition: landscape.h:1104
Population_Manager * SupplyThePopManager()
Get the pointer to the current main population manager.
Definition: landscape.h:175
int CorrectWidth(int x)
Definition: landscape.h:1567
int SupplyTreeAge(int, int)
Definition: landscape.h:509
bool m_toxShouldSpray
Definition: landscape.h:317
int SupplyFarmArea(int a_polyref)
Definition: landscape.h:1206
int SupplyRandomPondRef()
Returns random pond polyref.
Definition: Landscape.cpp:2610
void ReadOpenness(void)
Reads openness values from a standard input file for all polygons.
int SupplyTreeHeight(int)
Definition: landscape.h:816
int SupplySimAreaMinExtent(void)
int hb_StripingDist(void)
Definition: hedgebanks.cpp:225
bool BorderNeed(TTypesOfLandscapeElement a_letype)
Definition: Landscape.cpp:4529
int SupplyRandomPondIndex()
Returns random pond index.
Definition: Landscape.cpp:2606
void BeetleBankAdd(int x, int y, int angle, int length, LE *a_field, TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2971
TTypesOfPesticide m_PesticideType
An attribute to hold the pesticide type being tested, if there is one, if not default is -1.
Definition: landscape.h:278
~Landscape(void)
Definition: Landscape.cpp:1424
double SupplyGooseGrazingForageH(double a_height, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon based on the height onl...
Definition: landscape.h:541
bool SupplyMaleNewtPresent(int a_InPondIndex)
Determines if a male is present in a pond.
Definition: landscape.h:351
bool SupplyLEHigh(int a_x, int a_y)
Tests whether the polygon at a_x,a_y is designated as high.
Definition: landscape.h:455
PollenNectarQuality SupplyNectar(int a_polyref)
Definition: landscape.h:381
bool hb_HasNeighbourColor(int a_x, int a_y, int a_neighbour_color)
Definition: hedgebanks.cpp:452
FarmManager * SupplyFarmManagerPtr()
Definition: landscape.h:353
int SupplyWindDirection(void)
Definition: landscape.h:1423
vector< int > hb_hedges
Definition: landscape.h:263
GooseFieldList * GetGooseFields(double)
Gets the list of suitable goose foraging fields today.
Definition: Landscape.cpp:685
double SupplyMeanTemp(long a_date, unsigned int a_period)
Definition: landscape.h:1372
char m_versioninfo[30]
Definition: landscape.h:115
void DumpMapInfoByArea(const char *a_filename, bool a_append, bool a_dump_zero_areas, bool a_write_veg_names)
Definition: Landscape.cpp:3652
std::string PolytypeToString(TTypesOfLandscapeElement a_le_type)
Definition: Landscape.cpp:4087
void PolysRenumber(void)
Definition: Landscape.cpp:2057
LE * SupplyLEPointer(int a_polyref)
Definition: landscape.h:1099
int SupplyHour(void)
Get the hour of the day.
Definition: landscape.h:1586
double SupplyPolygonArea(int a_polyref)
Definition: landscape.h:523
TTypesOfVegetation SupplyLastSownVeg(int a_polyref)
Definition: landscape.h:1068
double SupplyRain(void)
Definition: landscape.h:1365
double SupplyPesticideS(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets soil pesticide for a location.
Definition: Landscape.cpp:616
int LineHighTest(int a_cx, int a_cy, double a_offsetx, double a_offsety)
Provides a measure of the shortest distance in using a vector from a_cx,a_cy unitl tall obstacles are...
Definition: Landscape.cpp:461
double SupplyDaylightProp()
Definition: landscape.h:825
int m_width10
Definition: landscape.h:140
bool BorderTest(int a_fieldpoly, int a_borderpoly, int a_x, int a_y)
Definition: Landscape.cpp:2452
LE * NewElement(TTypesOfLandscapeElement a_type)
Definition: Landscape.cpp:3688
bool BeetleBankPossible(LE *a_field, TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2772
int SupplyFarmOwnerIndex(int a_x, int a_y)
Definition: landscape.h:1165
bool SupplySkScrapes(int a_polyref)
Definition: landscape.h:981
int SupplyJustSprayed(int a_polyref)
Definition: landscape.h:1275
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: landscape.h:1535
void SetMaleNewtPresent(int a_InPondIndex)
Sets a male as being present in a pond.
Definition: landscape.h:349
int SupplyYear(void)
Definition: landscape.h:1611
int SupplyCentroidX(int a_x, int a_y)
Definition: landscape.h:474
void DumpVegAreaData(int a_day)
Definition: Landscape.cpp:4680
void BorderRemoval(void)
Definition: Landscape.cpp:2271
int SupplyMinute(void)
Get the minute of the hour.
Definition: landscape.h:1592
int * SupplyMagicMapP(int a_x, int a_y)
Definition: landscape.h:1509
void EventDumpPesticides(int x1, int y1)
Definition: Landscape.cpp:1720
void GISASCII_Output(string outpfile, int UTMX, int UTMY)
Write ASCII file of the ALMaSS map.
Definition: Landscape.cpp:3507
void hb_FindHedges(void)
Definition: hedgebanks.cpp:276
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
void InitOsmiaBeeNesting()
Read in the Osmia nest density files and allocate to each LE object.
Definition: Landscape.cpp:4697
int SupplySoilType(int a_x, int a_y)
Returns the soil type in ALMaSS types reference numbers.
Definition: landscape.h:460
RodenticideManager * m_RodenticideManager
Definition: landscape.h:157
void AddBeetleBanks(TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2723
int FindLongestAxis(int *x, int *y, int *a_length)
Definition: Landscape.cpp:2851
int SupplySimAreaWidth(void)
Definition: landscape.h:1632
void hb_DownPolyNumbers(void)
Definition: hedgebanks.cpp:715
APoint SupplyCentroidIndex(int a_polyrefindex)
Definition: Landscape.cpp:771
int m_y_add[8]
Definition: landscape.h:267
bool SubtractPondLarvalFood(double a_food, int a_polyrefindex)
Removes larval food from a pond and returns true if it was possible, otherwise false.
Definition: Landscape.cpp:664
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Definition: landscape.h:1648
void CheckForPesticideRecord(LE *a_field, TTypesOfPesticideCategory a_pcide)
Check if needed and record pesticide application.
Definition: Landscape.cpp:669
int SupplyPolyRefIndex(int a_x, int a_y)
Definition: landscape.h:1493
int SupplyPesticideCell(int a_polyref)
Definition: landscape.h:1468
double SupplyTotalPollen(int a_polyref)
Definition: landscape.h:379
bool SupplyIsCereal2(TTypesOfVegetation a_vege_type)
Definition: Landscape.cpp:532
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: landscape.h:1655
void DumpTreatCounters(const char *a_filename)
Definition: Landscape.cpp:3586
int SupplyDayInYear(void)
Definition: landscape.h:1596
int SupplyFarmOwner(int a_x, int a_y)
Definition: landscape.h:1152
int SupplyOpenness(int a_x, int a_y)
Get openness for a location.
Definition: landscape.h:453
APoint CorrectCoordsPt(int x, int y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: landscape.h:1544
void RebuildPolyMapping()
Definition: landscape.h:213
int SupplyVegAge(int a_Polyref)
Definition: landscape.h:1078
TTypesOfPesticide SupplyPesticideType(void)
Definition: landscape.h:433
void RodenticidePredatorsEvaluation(RodenticidePredators_Population_Manager *a_rppm)
Definition: Landscape.cpp:3032
int SupplyValidY(int a_polyref)
Definition: landscape.h:1481
void Tick(void)
Definition: Landscape.cpp:1467
bool SupplyJustMownVector(unsigned int a_index)
Definition: landscape.h:1258
void WriteOpenness(void)
Stores openness for all polygons to a standard file.
int GetQuarryNumbers(int a_poly)
This returns the number of geese which are legal quarry on the polygon the day before.
Definition: Landscape.cpp:3390
double * l_vegtype_areas
Definition: landscape.h:153
bool SupplyShouldSpray()
Definition: landscape.h:357
RodenticidePredators_Population_Manager * m_RodenticidePreds
Definition: landscape.h:158
void hb_ClearPolygon(int a_poly_num)
Definition: hedgebanks.cpp:413
bool SupplyHasTramlines(int a_x, int a_y)
Definition: landscape.h:1252
double SupplyBirdSeedForage(int a_polyref)
Returns the grain forage resource.
Definition: landscape.h:614
double SupplyTrafficLoad(int a_x, int a_y)
Definition: landscape.h:1293
vector< LE * > m_elems
List of all landscape elements. The index is a sequential number, to get the polynum look this number...
Definition: landscape.h:122
void hb_MarkTopFromLocalMax(int a_color)
Definition: hedgebanks.cpp:679
int SupplyCentroidX(int a_polyref)
Definition: landscape.h:470
void SetPolyMaxMinExtents(void)
Definition: Landscape.cpp:1622
double SupplyVegDigestability(int a_polyref)
Definition: landscape.h:919
void RemoveMissingValues()
A method for replacing missing values in the map with corrected ones - slow.
Definition: Landscape.cpp:2090
void hb_ResetColorBits(void)
Definition: hedgebanks.cpp:298
void SimulationClosingActions()
Definition: Landscape.cpp:1455
void ConsolidatePolys(void)
Definition: Landscape.cpp:1329
double SupplyRainPeriod(long a_date, int a_period)
Definition: landscape.h:1351
void AddGreenElement(LE *a_green)
int hb_height
Definition: landscape.h:270
double SupplyVegBiomassVector(unsigned int a_index)
Definition: landscape.h:948
PollenNectarQuality SupplyNectar(int a_x, int a_y)
Definition: landscape.h:382
int m_maxextent
Definition: landscape.h:143
int le_signal_index
Definition: landscape.h:319
void RecordGooseSpNumbers(int a_poly, int a_number, GooseSpecies a_goose)
This records the number of geese of each species on the polygon the day before. To prevent lots of un...
Definition: Landscape.cpp:3352
void ForceArea(void)
Definition: Landscape.cpp:2072
bool FindValidXY(int a_field, int &a_x, int &a_y)
Definition: Landscape.cpp:2688
double SupplySnowDepth(void)
Definition: landscape.h:1444
int m_treatment_counts[last_treatment]
Definition: landscape.h:193
void UpdateOsmiaNesting()
Tesll all LE objects to update their osmia nest status.
Definition: landscape.h:856
bool m_NeedCentroidCalculation
a flag to ensure centroid calculation on object construction
Definition: landscape.h:146
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_PF
Curve relatning goose intake rates in KJ/min to vegetation height.
Definition: landscape.h:160
bool SupplyVegPatchy(int a_polyref)
Definition: landscape.h:986
void ReadPolys2(const char *a_polyfile)
reads in polygon information. Version 2 including centroid and openness information
Definition: Landscape.cpp:1892
void RecordGooseNumbersTimed(int a_poly, int a_number)
This records the number of geese on the polygon the day before at a predefined time....
Definition: Landscape.cpp:3341
void BorderAdd(LE *a_field, TTypesOfLandscapeElement a_type)
Definition: Landscape.cpp:2347
bool ReadSymbols(const char *a_cfgfile)
Definition: landscape.h:788
int SupplyUnderGrowthWidth(int)
Definition: landscape.h:817
int SupplyValidX(int a_polyref)
Definition: landscape.h:1474
double SupplyPesticideP(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets plant pesticide for a location.
Definition: Landscape.cpp:605
int MagicMapP2PolyRef(int a_magic)
Definition: landscape.h:1516
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
void hb_MarkTheBresenhamWay(void)
Definition: hedgebanks.cpp:629
RasterMap * m_land
The big map.
Definition: landscape.h:125
int SupplyLECount(void)
Definition: Landscape.cpp:3562
void AxisLoopLtd(int a_poly, APoint *a_cor, int a_axis, int a_limit)
Definition: Landscape.cpp:2917
int SupplyPolyRefVector(unsigned int a_index)
Definition: landscape.h:1451
int SupplyLastTreatment(int a_polyref, int *a_index)
Definition: landscape.h:1331
const char * SupplyVersion(void)
Definition: landscape.h:778
bool hb_PaintWhoHasNeighbourColor(int a_neighbour_color, int a_new_color)
Definition: hedgebanks.cpp:526
double SupplyGreenBiomass(int a_polyref)
Definition: landscape.h:1017
double SupplyBirdSeedForage(int a_x, int a_y)
Returns the grain forage resource as seen from a goose standpoint at an x,y location.
Definition: landscape.h:621
TTypesOfVegetation SupplyVegTypeVector(unsigned int a_index)
Definition: landscape.h:1220
int SupplyElementSubType(int a_polyref)
Definition: landscape.h:1121
void DumpCentroids(void)
Definition: Landscape.cpp:3275
double GetActualGooseGrazingForage(int a_x, int a_y, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by x,...
Definition: landscape.h:596
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Definition: landscape.h:1321
double SupplyRodenticide(int a_x, int a_y)
Gets total rodenticide for a location.
Definition: Landscape.cpp:492
void CalculateCentroids(void)
Definition: Landscape.cpp:3040
int SupplyNumberOfFarms()
Definition: landscape.h:1148
int GetPolymapping(int a_index)
Definition: landscape.h:183
double SupplyTempPeriod(long a_date, int a_period)
Definition: landscape.h:1410
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
int SupplySoilTypeR(int a_x, int a_y)
Returns the soil type in rabbit warren reference numbers.
Definition: landscape.h:464
int SupplyFarmAnimalCensus(int a_farm_ref, int a_LifeStage)
Definition: Landscape.cpp:745
int CalulateFieldOpennessCentroid(int a_pref)
Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles...
Definition: Landscape.cpp:359
double SupplyVegCoverVector(unsigned int a_index)
Definition: landscape.h:1053
int m_x_add[8]
Definition: landscape.h:266
bool hb_HasOtherNeighbour(int a_x, int a_y)
Definition: hedgebanks.cpp:339
bool SupplyIsGrass2(TTypesOfVegetation a_vege_type)
Definition: Landscape.cpp:503
void DumpAllSymbolsAndExit(const char *a_dumpfile)
Definition: landscape.h:785
bool SupplyIsGrass(int a_polyref)
Definition: landscape.h:1310
double SupplyTotalPollen(int a_x, int a_y)
Definition: landscape.h:380
int SupplyLargestPolyNumUsed()
Definition: landscape.h:355
void PolysValidate(bool a_exit_on_invalid)
Definition: Landscape.cpp:1746
int SupplyOpenness(int a_poly)
Get openness for a polygon.
Definition: landscape.h:451
bool SupplyPesticideDecay(PlantProtectionProducts a_ppp)
Returns true if there is any pesticide in the system at all at this point.
Definition: Landscape.cpp:776
void ReadPolys(const char *a_polyfile)
bool SupplySnowcover(void)
Definition: landscape.h:1437
int SupplyTreeAge(int a_Polyref)
Definition: landscape.h:1315
bool SupplyIsCereal(int a_polyref)
Definition: landscape.h:1300
double SupplyNightProp()
Definition: landscape.h:826
PollenNectarQuality SupplyPollen(int a_x, int a_y)
Definition: landscape.h:378
double SupplyPondPesticide(int a_poly_index)
Get the pesticide concentration per liter from a pond (must be a pond index on calling)
Definition: landscape.h:761
Farm * SupplyFarmPtr(int a_owner)
Definition: landscape.h:352
double SupplyLATotal(int a_x, int a_y)
Definition: landscape.h:1004
void RecordGooseRoostDist(int a_polyref, int a_dist, GooseSpecies a_goose)
Records the distance to the closest roost of goose species.
Definition: Landscape.cpp:3373
int hb_max_x
Definition: landscape.h:272
bool UMarginTest(int a_fieldpoly, int a_borderpoly, int a_x, int a_y, int a_width)
Definition: Landscape.cpp:2669
void PolysDump(const char *a_filename)
Definition: Landscape.cpp:1803
void SetPolymapping(int a_index, int a_val)
Definition: landscape.h:182
Landscape(void)
Definition: Landscape.cpp:814
void hb_Add(void)
Definition: hedgebanks.cpp:56
void DumpMap(const char *a_filename)
Definition: Landscape.cpp:1386
LE_Signal SupplyLESignal(int a_polyref)
Definition: Landscape.cpp:3566
bool PolysRemoveInvalid(void)
Definition: Landscape.cpp:1772
void hb_UpPolyNumbers(void)
Definition: hedgebanks.cpp:289
double SupplyBirdMaizeForage(int a_x, int a_y)
Returns the maize forage resource as seen from a goose standpoint at an x,y location.
Definition: landscape.h:640
void ReleaseOsmiaNest(int a_x, int a_y)
Reopen the osmia nest here
Definition: landscape.h:871
bool hb_FindBoundingBox(int a_poly_num)
Definition: hedgebanks.cpp:243
int hb_max_y
Definition: landscape.h:273
double SupplyBirdMaizeForage(int a_polyref)
Returns the maize forage resource.
Definition: landscape.h:628
int SupplyMonth(void)
Definition: landscape.h:1601
int SupplyCentroidY(int a_x, int a_y)
Definition: landscape.h:475
void UnsprayedMarginAdd(LE *a_field)
Definition: Landscape.cpp:2617
unsigned int SupplyNumberOfPolygons(void)
Definition: landscape.h:1461
int CorrectHeight(int y)
Definition: landscape.h:1573
int SupplyRoadWidth(int, int)
Definition: landscape.h:811
double SupplyVegBiomass(int a_polyref)
Definition: landscape.h:953
bool StepOneValid(int a_polyindex, int a_x, int a_y, int step)
Definition: Landscape.cpp:2429
int hb_first_free_poly_num
Definition: landscape.h:274
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
A farm that carries out crop, pesticide and fertilizer planning using simplified optimisation or othe...
Definition: farm.h:2029
Definition: pesticide.h:107
Definition: pesticide.h:370
A polynomial curve class.
Definition: CurveClasses.h:90
Ponds are defined as freshwater bodies between 25m2 and 5000m2. For newts the effective size is limit...
Definition: elements.h:1183
Base class for all population managers.
Definition: PopulationManager.h:424
Definition: rastermap.h:41
int Get(int a_x, int a_y)
Definition: rastermap.h:81
int * GetMagicP(int a_x, int a_y)
Definition: rastermap.h:74
Class for management of bait locations.
Definition: Rodenticide.h:73
Definition: RodenticidePredators.h:51
Definition: skylarks_all.h:343
double GetWindPeriod(long a_date, unsigned int a_period)
Definition: weather.cpp:262
bool GetSnow(long a_date)
Definition: weather.cpp:132
double GetWind(long a_date)
Definition: weather.h:425
double GetMeanTemp(long a_date, unsigned int a_period)
Definition: weather.cpp:120
double GetRain(long a_date)
Definition: weather.h:423
int GetWindDirection(void)
Definition: weather.h:427
double GetRainPeriod(long a_date, unsigned int a_period)
Definition: weather.cpp:253
double GetTemp(long a_date)
Get the temperature on a particular date.
Definition: weather.h:417
double GetTempPeriod(long a_date, unsigned int a_period)
Definition: weather.cpp:272
double GetGlobalRadiation(long a_date)
Definition: weather.h:414
double GetHumidity(void)
Get the humidity score today.
Definition: weather.h:421
double GetSnowDepth(void)
Get the current snow depth.
Definition: weather.h:431
class Configurator * g_cfg
Definition: configurator.cpp:49
CfgSecureLevel
Definition: configurator.h:59
class LE_TypeClass * g_letype
Definition: elements.cpp:277
unsigned int LE_Signal
Definition: elements.h:35
PlantProtectionProducts
A list PPP names for tracking by the Pesticide class.
Definition: farm.h:421
TTypesOfOptFarms
Definition: farm.h:278
TTypesOfFarm
Definition: farm.h:222
vector< unsigned > polylist
Definition: farm.h:207
const int January
Definition: landscape.h:36
TTypeOfDirections
ALMaSS 8 standard directions
Definition: landscape.h:59
@ direction_se
Definition: landscape.h:60
@ direction_nw
Definition: landscape.h:60
@ direction_w
Definition: landscape.h:60
@ direction_s
Definition: landscape.h:60
@ direction_ne
Definition: landscape.h:60
@ direction_n
Definition: landscape.h:60
@ direction_e
Definition: landscape.h:60
@ direction_sw
Definition: landscape.h:60
const int June
Definition: landscape.h:41
const int November
Definition: landscape.h:46
const int October
Definition: landscape.h:45
const int July
Definition: landscape.h:42
const int March
Definition: landscape.h:38
const int May
Definition: landscape.h:40
const int September
Definition: landscape.h:44
std::vector< GooseFieldListItem > GooseFieldList
A list of GooseFieldListItem s.
Definition: landscape.h:103
const int August
Definition: landscape.h:43
const int April
Definition: landscape.h:39
const int February
Definition: landscape.h:37
class Pesticide * g_pest
Definition: pesticide.cpp:92
const int December
Definition: landscape.h:47
TTypesOfPesticideCategory
Definition: landscape.h:63
@ insecticide
Definition: landscape.h:63
@ fungicide
Definition: landscape.h:63
@ testpesticide
Definition: landscape.h:63
@ herbicide
Definition: landscape.h:63
TTypesOfPesticide
Definition: landscape.h:66
@ ttop_ModelinkPesticide
Definition: landscape.h:71
@ ttop_ModelinkPesticide21TWA
Definition: landscape.h:72
@ ttop_NoPesticide
Definition: landscape.h:67
@ ttop_AcuteEffects
Definition: landscape.h:68
@ ttop_eggshellthinning
Definition: landscape.h:75
@ ttop_GeneticDemo
Definition: landscape.h:73
@ ttop_Vinclozolin
Definition: landscape.h:70
@ ttop_MultipleEffects
Definition: landscape.h:74
@ ttop_AcuteDelayedEffects
Definition: landscape.h:76
@ ttop_ReproductiveEffects
Definition: landscape.h:69
class MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
@ WARN_MSG
Definition: maperrormsg.h:38
A list item entry of field polygon reference numbers with associated openness and goose food scores.
Definition: landscape.h:81
double grass[gs_foobar]
Definition: landscape.h:91
TTypesOfVegetation vegtype
Definition: landscape.h:92
int geese
Definition: landscape.h:83
double grain
Definition: landscape.h:89
std::string vegtypechr
Definition: landscape.h:93
std::string lastsownveg
Definition: landscape.h:98
int polyref
Definition: landscape.h:82
std::string debugveg
Definition: landscape.h:99
double digestability
Definition: landscape.h:95
double openness
Definition: landscape.h:88
double maize
Definition: landscape.h:90
int geesespTimed[gs_foobar]
Definition: landscape.h:86
std::string previouscrop
Definition: landscape.h:97
int geeseTimed
Definition: landscape.h:85
int roostdists[gs_foobar]
Definition: landscape.h:87
double vegheight
Definition: landscape.h:94
int vegphase
Definition: landscape.h:96
int geesesp[gs_foobar]
Definition: landscape.h:84
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
@ tole_PermPastureTussocky
Definition: tole_declaration.h:45
@ tole_WoodyEnergyCrop
Definition: tole_declaration.h:94
@ tole_PermPastureTussockyWet
Definition: tole_declaration.h:100
@ tole_PermanentSetaside
Definition: tole_declaration.h:46
@ tole_Field
Definition: tole_declaration.h:43
@ tole_PermPasture
Definition: tole_declaration.h:47
@ tole_Vildtager
Definition: tole_declaration.h:99
@ tole_Orchard
Definition: tole_declaration.h:71
@ tole_YoungForest
Definition: tole_declaration.h:55
@ tole_PermPastureLowYield
Definition: tole_declaration.h:44
TTypesOfVegetation
Definition: tov_declaration.h:30
@ last_treatment
Definition: treatment.h:113
class Weather * g_weather
Definition: weather.cpp:41